package cn.wolfcode.crm.qo;

import lombok.*;
import org.springframework.util.StringUtils;

@Setter
@Getter
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class QueryObject {

    private int currentPage = 1; //当前页
    private int pageSize = 3; //页面大小
    private String keyword;

    /**
     * start 是起始页
     * @return
     */
    private int getStart() {
        return (currentPage - 1) * pageSize;
    }

    public String getKeyword() {
        return StringUtils.hasLength(keyword) ? keyword : null;
    }

}
